package com.sz.common.core.system.event;

import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import com.sz.common.core.system.service.AuthorizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Function: 删除角色事件监听，主要删除角色资源的关系表. <br>
 * Date: 2017年02月17日 14:12 <br>
 * Author: wentao.chang
 */
@Component
public class RoleDeletionListener {

    @Autowired
    private EventBus eventBus;

    @Autowired
    private AuthorizationService authorizationService;

    @PostConstruct
    public void registerSelf() {
        eventBus.register(this);
    }

    @Subscribe
    public void onEvent(RoleDeletionEvent event) {
        int lastMessage = event.getRoleId();
        System.out.println(lastMessage);
    }


}
